home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: jdmorris@ix.netcom.com (Jason D. Morris)
- Newsgroups: comp.lang.c++
- Subject: Re: Braces and Inline Assembly?
- Date: Sat, 03 Feb 1996 01:28:44 GMT
- Organization: Netcom
- Message-ID: <4eudng$59c@ixnews7.ix.netcom.com>
- References: <4eubgp$6ui@ixnews6.ix.netcom.com>
- NNTP-Posting-Host: ix-pon-mi1-17.ix.netcom.com
- X-NETCOM-Date: Fri Feb 02 5:28:16 PM PST 1996
- X-Newsreader: Forte Free Agent 1.0.82
-
- mchamp@ix.netcom.com (Michael Champagne) wrote:
-
- >Ok.. I'm new to using inline assembly and I was wondering why this
- >compiles:
-
- >void set_mode(const int mode)
- >{
- > asm {
- > mov AH, 0;
- > mov AL, byte ptr mode;
- > int 10h;
- > }
- >}
-
- >and this doesn't..
-
- >void set_mode(const int mode)
- >{
- > asm
- > {
- > mov AH, 0;
- > mov AL, byte ptr mode;
- > int 10h;
- > }
- >}
-
- >Seems like it's the exact same code.. does the placement of the
- >braces matter when using the 'asm' statement? In the second one the
- >compiler doesn't recognize the 'mov' and says there needs to be a
- >couple of semicolons stuck in there.
-
- >Thanks in advance,
-
- >Mike
-
-
- Sounds like you're using an older version of Borland C/C++. Perhaps
- version 3.1 or prior? In those versions the opening brace is required
- on the same line as the the asm keyword. In later versions, the brace
- doesn't have to be anywhere special.
-
- Jason
-
-
-